package com.th.review;


import java.lang.reflect.Proxy;

/**
 * @author ThreePure
 * @date 2022/5/23 16:09
 * @description: 主入口
 * @since 1.8
 */
public class MyProxy {
    public static void main(String[] args) {
        Class[] interfaces = {Saleable.class};
        Saleable sale = (Saleable) Proxy.newProxyInstance(MyProxy.class.getClassLoader(), interfaces, new StrangeClass(new BookSale()));
        int saled = sale.saled(20);
        System.out.println("[Result:]"+saled);

    }
}
